package com.taiji.dianthus.domain.sms;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Proxy;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

/**
 * @ClassName SmsGroupUser
 * @Description 用户组-用户信息中间表 实体
 * @Author H.M
 * @Date 2020/7/14
 */
@Entity
@Table(name = "t_sms_group_user")
@Proxy(lazy = false)
@JsonIgnoreProperties({"handler", "hibernateLazyInitializer"})
@ApiModel(description = "用户组-用户信息中间表")
public class SmsGroupUser {


    @Id
    @GeneratedValue(generator = "jpa-uuid")
    @Column(name = "id")
    @ApiModelProperty(value = "主键", name = "id")
    private String id;

    @Column(name = "group_id")
    @ApiModelProperty(value = "用户组ID", name = "groupId")
    private String groupId;

    @Column(name = "user_phone")
    @ApiModelProperty(value = "用户手机号", name = "userPhone")
    private String userPhone;

    @Column(name = "user_name")
    @ApiModelProperty(value = "用户名", name = "userName")
    private String userName;

    @Column(name = "create_time", insertable = false, updatable = false)
    private Date createTime;

    @Column(name = "enable_flag", insertable = false, updatable = false)
    private Integer enableFlag;

    @Column(name = "user_flag")
    @ApiModelProperty(value = "用户标签  0 通讯录用户 1 自定义用户", name = "userName")
    private Integer userFlag;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getGroupId() {
        return groupId;
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public String getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Date getCreateTime() {
        return createTime;
    }


    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getEnableFlag() {
        return enableFlag;
    }

    public void setEnableFlag(Integer enableFlag) {
        this.enableFlag = enableFlag;
    }

    public Integer getUserFlag() {
        return userFlag;
    }

    public void setUserFlag(Integer userFlag) {
        this.userFlag = userFlag;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SmsGroupUser that = (SmsGroupUser) o;
        return Objects.equals(groupId, that.groupId) &&
                Objects.equals(userPhone, that.userPhone) &&
                Objects.equals(userName, that.userName);
    }

    @Override
    public int hashCode() {

        return super.hashCode();
    }
}
